home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 3 / QRZ Ham Radio Callsign Database - Volume 3.iso / world / mac / digital / sftksrcs.hqx / SoftKiss.src.1.8 / driver_shell / driver_shell.h < prev    next >
Text File  |  1993-03-08  |  3KB  |  112 lines

  1. /*
  2.  * driver_shell - code for dynamicly installing a driver
  3.  * at runtime
  4.  * SoftKiss
  5.  * by Aaron Wohl / N3LIW (aw0g+@andrew.cmu.edu) jul 1990
  6.  * 6393 Penn Ave #303
  7.  * Pittsburgh PA, 15206
  8.  * work: (412)-268-5032
  9.  * home: (412)-731-6159
  10.  */
  11.  
  12. #define ds_NAME_LEN (48)    /*name length field including length byte*/
  13.  
  14. struct driver_shell_header_R {
  15.     short    drvrFlags;
  16.     short    drvrDelay;
  17.     short    drvrEMask;        /*just used for DAs*/
  18.     short    drvrMenu;        /*just used for DAs*/
  19. /*offsets to routines*/
  20.     short    drvrOpen;
  21.     short    drvrPrime;
  22.     short    drvrCtl;
  23.     short    drvrStatus;
  24.     short    drvrClose;
  25.  
  26.     unsigned char drvrName[ds_NAME_LEN]; /*pstring name of driver*/
  27.     long call_me;        /*routine to call*/
  28.     long iba4;            /*a4 reg value when in use*/
  29.     long iba5;            /*a5 reg value*/
  30.     long sh_more;        /*extra argument*/
  31.     long sh_reserve[2];    /*reserved for future expansion*/
  32. };
  33. typedef struct driver_shell_header_R driver_shell_header,*driver_shell_header_pt;
  34.  
  35. #define sh_OPEN     0
  36. #define sh_PRIME    1
  37. #define sh_CONTROL    2
  38. #define sh_STATUS    3
  39. #define sh_CLOSE    4
  40.  
  41. /*
  42.  * prepare a driver template to be a certain driver
  43.  * returns true if successfull
  44.  */
  45. int sh_prepare(
  46.     driver_shell_header_pt ads,
  47.     unsigned char *aname,
  48.     short aFlags,
  49.     short aDelay,
  50.     long acall_me,
  51.     long aiba4,
  52.     long aiba5,
  53.     long ash_more);
  54.  
  55. /*
  56.  * return a5 for driver_shell to set when it calls us back
  57.  * a5 is used when this module is linked to a test application
  58.  * normaly we are part of a driver and a4 is used
  59.  */
  60. long sh_geta5(void);
  61.  
  62. /*
  63.  * return a4 for driver_shell to set when it calls us back
  64.  */
  65. long sh_geta4(void);
  66.  
  67. /*
  68.  * install the passed driver
  69.  * apple never got around to the glue for this call
  70.  * if they ever do this routine should be removed
  71.  */
  72. short DrvrInstall(Handle drvrHandle, short dRef);
  73.  
  74. /*
  75.  * remove the passed device driver
  76.  * apple never got around to the glue for this call
  77.  * if they ever do this routine should be removed
  78.  */
  79. short DrvrRemove(short refNum);
  80.  
  81. /*
  82.  * Drvr install doesn't do anything except fill in dCtlRefNum
  83.  * so follow up and copy over the drivers info.
  84.  * Handle passed in should be locked
  85.  */
  86. short Real_DrvrInstall(Handle DrvrHandle, short dRef);
  87.  
  88. /*
  89.  * load the driver template into memory
  90.  * returns nil if it can't be loaded
  91.  */
  92. Handle sh_read_in_driver_shell(void);
  93.  
  94. /*
  95.  * return a duplicate of the passed handle
  96.  * the copy will be in the system heap
  97.  * and moved high and locked
  98.  */
  99. Handle sh_copy_template(Handle sh_template);
  100.  
  101. /*
  102.  * a resource into the system heap by name
  103.  * returns nil if it can't be loaded
  104.  */
  105. Handle sh_read_in_sys_res(ResType id,unsigned char *name);
  106.  
  107. /*
  108.  * strip address that strips even before 32bit addressing is on
  109.  * so the address will still be valid later
  110.  */
  111. void *sh_strip_address(void *addr);
  112.